import cv2 as cv
fframe = 0


def onMouse(event, x, y, flags, param):
    global fframe
    if event == cv.EVENT_LBUTTONDOWN:
        fframe = frame


cap = cv.VideoCapture(0)
cv.namedWindow('123')
cv.resizeWindow("123", 640, 320)
cv.namedWindow('321')
cv.resizeWindow('321', 640, 320)
cv.setMouseCallback('123', onMouse)
while cv.waitKey(30) != 27:
    success, frame = cap.read()
    if success:
        cv.imshow('123', frame)
#        cv.imshow('321', fframe)
cv.imshow('321', fframe)
cv.destroyWindow()
cap.release()
